/*
 * Background Flickr: Copyright (C) 2009  Craig McNicholas
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.ddw.app.bflickr.imaging;

import android.graphics.Bitmap;

/**
 * Listener interface for downloading images and responding
 * to raised events.
 * @author craig
 *
 */
public interface ImageCollectorListener {

	/**
	 * This method is raised if there is a problem downloading 
	 * an image.
	 * @param throwable the thrown exception orginating from the actual error
	 */
	public void onDownloadError(Throwable throwable);

	/**
	 * This method is raised if there is a problem caching the image 
	 * or obtaining the image from the existing cache.
	 * @param throwable the thrown exception orginating from the actual error
	 */
	public void onCacheError(Throwable throwable);

	/**
	 * This method is raised if the download is successful, this could 
	 * be very fast if the images have been cached already.
	 * @param image the image file that was downloaded
	 * @param fromCache whether the image was loaded from the cache
	 */
	public void onDownloadCompleted(Bitmap image, boolean fromCache);

}